<?php
/*
* Author: Nurte
* @package www.nurte.pl Nurte Facebook Like Box
* @copyright Copyright (C) 2010 Nurte sp. z o.o. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* Version 1.2.0.0
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
$nurte_fb_likebox = nurte_fb_likebox( $params );
echo $nurte_fb_likebox;

function nurte_fb_likebox( $params )   {
	$language	= &JFactory::getLanguage();
	$langtag	= 'en_GB';
	if ($language) $langtag = str_replace("-","_",$language->get('tag'));

	$uri		= &JFactory::getURI();
	$scheme		= $uri->getScheme();
	
	$css_url	= trim($params->get('css'));
	$css_url 	= $css_url == '' ? '' : ' css="'.$css_url.'"';

	$fb_likebox    = '<script src="'.$scheme.'://connect.facebook.net/'.$langtag.'/all.js#xfbml=1"></script>'
			.'<fb:fan profile_id="'.trim( $params->get('pageid') ).'"'
			.' width ="'.trim( $params->get('width') ).'"' 
			.' height="'.trim( $params->get('height') ).'"'
			.' connections ="'.trim( $params->get('connections') ).'"'	 
			.' stream ="'.trim( $params->get('stream') ).'"' 
			.' logobar="'.trim( $params->get('logobar') ).'"'
			.$css_url.'></fb:fan>'
			.' <noscript>JavaScript must be enabled in order for you to use the Nurte Facebook Like Box. However, it seems JavaScript is either disabled or not supported by your browser. To use the Nurte Facebook Like Box, enable JavaScript by changing your browser options, then <a href="'.$uri->toString().'">try again.</a></noscript>';

	return $fb_likebox;
}
?>
